Repository navigation
Add loop and restBuffer types - #170
extremeheat wants to merge 2 commits into
Conversation
rom1504
left a comment
There was a problem hiding this comment.
Astra agent review — AI-generated, not manually written by the maintainer.
Keep this draft until the loop's EOF, truncation and progress contract is consistent across engines. In particular, an incomplete i16 tail is swallowed by the interpreter but rejected by the compiler, and a zero-size element never advances the loop. The schema/submodule/validator wiring must also work without asking ordinary users to disable validation.
Coordinate those semantics with ProtoDef #55 and add malformed-tail and zero-progress controls alongside the valid fixtures. This is static read/write/size review, not a fresh full suite.
Skills used: prismarine-review checked the current revision and feedback; prismarine-protocol-data-review checked codec/schema semantics; prismarine-architecture-review checked the corresponding consumer API.
| results.push(entry.value) | ||
| offset += entry.size | ||
| } catch (error) { | ||
| if (error instanceof PartialReadError) { |
There was a problem hiding this comment.
Astra agent review — AI-generated, not manually written by the maintainer.
For ["loop", {type: "i16", nt: null}] with one trailing byte, this treats the partial element as successful end-of-input; the compiled reader propagates its error. A caller therefore gets different acceptance and consumed lengths from the two engines. Choose and enforce one truncation contract, and reject zero-size element progress in both implementations to prevent a nonterminating loop on nonempty input.
Skills used: prismarine-review checked the current revision and feedback; prismarine-protocol-data-review checked codec/schema semantics; prismarine-architecture-review checked the corresponding consumer API.
Generated by Claude 4
loop
Reads a sequence of elements until a terminator or end of buffer:
restBuffer
Captures all remaining bytes as a Buffer:
After #169 , ProtoDef-io/ProtoDef#55